/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sv.com.compassion.entidades;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/** Clase entidad para el mapeo de tabla de base de datos Tutor
* @author grupo de Tesis
*/
@Entity
@Table(name = "tutor")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tutor.findAll", query = "SELECT t FROM Tutor t"),
    @NamedQuery(name = "Tutor.findByIdTutor", query = "SELECT t FROM Tutor t WHERE t.idTutor = :idTutor"),
    @NamedQuery(name = "Tutor.findByNomTutor", query = "SELECT t FROM Tutor t WHERE t.nomTutor = :nomTutor"),
    @NamedQuery(name = "Tutor.findByApeTutor", query = "SELECT t FROM Tutor t WHERE t.apeTutor = :apeTutor"),
    @NamedQuery(name = "Tutor.findByFecNacimiento", query = "SELECT t FROM Tutor t WHERE t.fecNacimiento = :fecNacimiento"),
    @NamedQuery(name = "Tutor.findByEdaTutor", query = "SELECT t FROM Tutor t WHERE t.edaTutor = :edaTutor"),
    @NamedQuery(name = "Tutor.findByDirTutor", query = "SELECT t FROM Tutor t WHERE t.dirTutor = :dirTutor"),
    @NamedQuery(name = "Tutor.findBySexTutor", query = "SELECT t FROM Tutor t WHERE t.sexTutor = :sexTutor"),
    @NamedQuery(name = "Tutor.findByDuiTutor", query = "SELECT t FROM Tutor t WHERE t.duiTutor = :duiTutor"),
    @NamedQuery(name = "Tutor.findByEstCivil", query = "SELECT t FROM Tutor t WHERE t.estCivil = :estCivil"),
    @NamedQuery(name = "Tutor.findByTelTutor", query = "SELECT t FROM Tutor t WHERE t.telTutor = :telTutor"),
    @NamedQuery(name = "Tutor.findByCelTutor", query = "SELECT t FROM Tutor t WHERE t.celTutor = :celTutor"),
    @NamedQuery(name = "Tutor.findByEstTutor", query = "SELECT t FROM Tutor t WHERE t.estTutor = :estTutor"),
    @NamedQuery(name = "Tutor.findByAuAddUsr", query = "SELECT t FROM Tutor t WHERE t.auAddUsr = :auAddUsr"),
    @NamedQuery(name = "Tutor.findByAuAddDat", query = "SELECT t FROM Tutor t WHERE t.auAddDat = :auAddDat"),
    @NamedQuery(name = "Tutor.findByAuModUsr", query = "SELECT t FROM Tutor t WHERE t.auModUsr = :auModUsr"),
    @NamedQuery(name = "Tutor.findByAuModDat", query = "SELECT t FROM Tutor t WHERE t.auModDat = :auModDat")})
public class Tutor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idTutor")
    private Integer idTutor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "nomTutor")
    private String nomTutor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "apeTutor")
    private String apeTutor;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecNacimiento")
    @Temporal(TemporalType.DATE)
    private Date fecNacimiento;
    @Basic(optional = false)
    @NotNull
    @Column(name = "edaTutor")
    private int edaTutor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "dirTutor")
    private String dirTutor;
    @Basic(optional = false)
    @NotNull
    @Column(name = "sexTutor")
    private char sexTutor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "duiTutor")
    private String duiTutor;
    @Basic(optional = false)
    @NotNull
    @Column(name = "estCivil")
    private int estCivil;
    @Size(max = 9)
    @Column(name = "telTutor")
    private String telTutor;
    @Size(max = 9)
    @Column(name = "celTutor")
    private String celTutor;
    @Basic(optional = false)
    @NotNull
    @Column(name = "estTutor")
    private int estTutor;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddUsr")
    private int auAddUsr;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddDat")
    @Temporal(TemporalType.DATE)
    private Date auAddDat;
    @Column(name = "AuModUsr")
    private Integer auModUsr;
    @Column(name = "AuModDat")
    @Temporal(TemporalType.DATE)
    private Date auModDat;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idTutor")
    private Collection<Actividad> actividadCollection;
    @JoinColumn(name = "idTipoTutor", referencedColumnName = "idTipoTutor")
    @ManyToOne(optional = false)
    private Tipotutor idTipoTutor;
    @JoinColumn(name = "idNivEsc", referencedColumnName = "idNivelEscolaridad")
    @ManyToOne(optional = false)
    private Nivelescolaridad idNivEsc;
    @JoinColumn(name = "idCdi", referencedColumnName = "idCdi")
    @ManyToOne(optional = false)
    private Cdi idCdi;

    public Tutor() {
    }

    public Tutor(Integer idTutor) {
        this.idTutor = idTutor;
    }

    public Tutor(Integer idTutor, String nomTutor, String apeTutor, Date fecNacimiento, int edaTutor, String dirTutor, char sexTutor, String duiTutor, int estCivil, int estTutor, int auAddUsr, Date auAddDat) {
        this.idTutor = idTutor;
        this.nomTutor = nomTutor;
        this.apeTutor = apeTutor;
        this.fecNacimiento = fecNacimiento;
        this.edaTutor = edaTutor;
        this.dirTutor = dirTutor;
        this.sexTutor = sexTutor;
        this.duiTutor = duiTutor;
        this.estCivil = estCivil;
        this.estTutor = estTutor;
        this.auAddUsr = auAddUsr;
        this.auAddDat = auAddDat;
    }

    public Integer getIdTutor() {
        return idTutor;
    }

    public void setIdTutor(Integer idTutor) {
        this.idTutor = idTutor;
    }

    public String getNomTutor() {
        return nomTutor;
    }

    public void setNomTutor(String nomTutor) {
        this.nomTutor = nomTutor;
    }

    public String getApeTutor() {
        return apeTutor;
    }

    public void setApeTutor(String apeTutor) {
        this.apeTutor = apeTutor;
    }

    public Date getFecNacimiento() {
        return fecNacimiento;
    }

    public void setFecNacimiento(Date fecNacimiento) {
        this.fecNacimiento = fecNacimiento;
    }

    public int getEdaTutor() {
        return edaTutor;
    }

    public void setEdaTutor(int edaTutor) {
        this.edaTutor = edaTutor;
    }

    public String getDirTutor() {
        return dirTutor;
    }

    public void setDirTutor(String dirTutor) {
        this.dirTutor = dirTutor;
    }

    public char getSexTutor() {
        return sexTutor;
    }

    public void setSexTutor(char sexTutor) {
        this.sexTutor = sexTutor;
    }

    public String getDuiTutor() {
        return duiTutor;
    }

    public void setDuiTutor(String duiTutor) {
        this.duiTutor = duiTutor;
    }

    public int getEstCivil() {
        return estCivil;
    }

    public void setEstCivil(int estCivil) {
        this.estCivil = estCivil;
    }

    public String getTelTutor() {
        return telTutor;
    }

    public void setTelTutor(String telTutor) {
        this.telTutor = telTutor;
    }

    public String getCelTutor() {
        return celTutor;
    }

    public void setCelTutor(String celTutor) {
        this.celTutor = celTutor;
    }

    public int getEstTutor() {
        return estTutor;
    }

    public void setEstTutor(int estTutor) {
        this.estTutor = estTutor;
    }

    public int getAuAddUsr() {
        return auAddUsr;
    }

    public void setAuAddUsr(int auAddUsr) {
        this.auAddUsr = auAddUsr;
    }

    public Date getAuAddDat() {
        return auAddDat;
    }

    public void setAuAddDat(Date auAddDat) {
        this.auAddDat = auAddDat;
    }

    public Integer getAuModUsr() {
        return auModUsr;
    }

    public void setAuModUsr(Integer auModUsr) {
        this.auModUsr = auModUsr;
    }

    public Date getAuModDat() {
        return auModDat;
    }

    public void setAuModDat(Date auModDat) {
        this.auModDat = auModDat;
    }

    @XmlTransient
    public Collection<Actividad> getActividadCollection() {
        return actividadCollection;
    }

    public void setActividadCollection(Collection<Actividad> actividadCollection) {
        this.actividadCollection = actividadCollection;
    }

    public Tipotutor getIdTipoTutor() {
        return idTipoTutor;
    }

    public void setIdTipoTutor(Tipotutor idTipoTutor) {
        this.idTipoTutor = idTipoTutor;
    }

    public Nivelescolaridad getIdNivEsc() {
        return idNivEsc;
    }

    public void setIdNivEsc(Nivelescolaridad idNivEsc) {
        this.idNivEsc = idNivEsc;
    }

    public Cdi getIdCdi() {
        return idCdi;
    }

    public void setIdCdi(Cdi idCdi) {
        this.idCdi = idCdi;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTutor != null ? idTutor.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tutor)) {
            return false;
        }
        Tutor other = (Tutor) object;
        if ((this.idTutor == null && other.idTutor != null) || (this.idTutor != null && !this.idTutor.equals(other.idTutor))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.com.compassion.entidades.Tutor[ idTutor=" + idTutor + " ]";
    }
    
}
